#include<stdio.h>
#include<string.h>

int main()
{
    char s[1024];
    scanf("%[^\n]", s);
    int tmp = 0, sum = 0, cnt = 0, l = 0, r = 0;
    int i = 0;
    while(s[i] != '\0' && (s[i] == ' ' || s[i] == '.'))
    {
        i++;
    }
    if(s[i] == '\0')
    {
        printf("The average word length: 0\n");
        printf("the longest word entered: \n");
        return 0;
    }

    int max_l = -1;
    for(i=0;i<strlen(s)+1;i++)
    {
        if(s[i] == ' ' || s[i] == '.' || s[i] == '\0')
        {
            if(tmp != 0)
            {
                cnt++;
                sum += tmp;
                if(tmp > max_l)
                {
                    l = i - tmp;
                    r = i;
                    max_l = tmp;
                }
            }
            tmp = 0;
            continue;
        }
        tmp++;
    }
    char res[1024];
    memcpy(res, s + l, r - l);
    res[r-l] = '\0';
    printf("The average word length: %.2lf\n", (double)sum / (double)cnt);
    printf("the longest word entered: %s\n", res);
    return 0;
} 
